﻿<UserControl x:Class="QuizzMasterStudio.Question.FreeResponseQuestion"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:s="clr-namespace:QuizzMasterStudio.QuizzGame"
             xmlns:quizz="clr-namespace:QuizzMasterStudio.Question"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="500">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="4">
            <Grid.Background>
                <LinearGradientBrush>
                    <GradientStop Offset="0" Color="#dfdfdf" />
                    <GradientStop Offset="1" Color="#ededed" />
                </LinearGradientBrush>
            </Grid.Background>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <StackPanel Grid.Column="0" Background="Transparent"
                        Orientation="Horizontal" >
                <Button Name="btnSaveOptions" Margin="2" Height="32" Click="btnSaveOptions_Click">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Image Grid.Column="0" Source="/QuizzMasterStudio;component/Images/save.png" Stretch="Uniform"
                            MaxHeight="25"/>
                        <Label Grid.Column="1" Content="Save As" FontSize="12" />
                    </Grid>
                </Button>
                <Button Name="btnLaunchQuizz" Margin="2" Height="32">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Image Grid.Column="0" Source="/QuizzMasterStudio;component/Images/question.png" 
                               Stretch="Uniform" MaxHeight="25"/>
                        <Label Grid.Column="1" Content="Launch Quizz" FontSize="12" />
                    </Grid>
                </Button>
            </StackPanel>
            
            <StackPanel Grid.Column="1" FlowDirection="RightToLeft" Background="Transparent"
                        Orientation="Horizontal">
                <Button Name="btnCancel" Margin="2" Height="32" Click="btnCancel_Click">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Image Grid.Column="1" Source="/QuizzMasterStudio;component/Images/Cancel.png" Stretch="Uniform"
                                MaxHeight="25"/>
                        <Label Grid.Column="0" Content="Cancel" />
                    </Grid>
                </Button>
                <Button Name="btnApply" Margin="2" Height="32" Click="btnApply_Click">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Image Grid.Column="1" Source="/QuizzMasterStudio;component/Images/ok.png" Stretch="Uniform"
                               MaxHeight="25"/>
                        <Label Grid.Column="0" Content="Apply" />
                    </Grid>
                </Button>
            </StackPanel>
        </Grid>
        
        <Grid Grid.Row="1" Background="#efefef">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="2" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Label Content="Problem Name:" FontWeight="Bold" Grid.Column="0" Grid.Row="1" />
                <TextBox Name="tbxProbName" Grid.Column="1" Grid.Row="1" Margin="2" FontSize="15"/>
                <Border Height="1" VerticalAlignment="Bottom" Grid.ColumnSpan="2" Grid.Row="1"
                        Background="#afafaf"/>
            </Grid>
            <quizz:FreeResponseTextBox x:Name="ftbQuestion" Title="Question" Grid.Row="1" />
        </Grid>
        
        <Grid Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="250" />
            </Grid.ColumnDefinitions>
            
            <quizz:AnswerList x:Name="alAnswers" Grid.Column="0" />

            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <ComboBox Name="cmbEditMode" SelectedIndex="0">
                    <ComboBoxItem Content="User Preferences" Name="cbiUserPreferences" />
                    <ComboBoxItem Content="Default Settings" IsEnabled="True"
                                  Name="cbiDefaultSettings"/>
                </ComboBox>
                <GroupBox Grid.Row="1" Margin="0,0,3,3">
                    <GroupBox.Header>
                        <CheckBox Content="Override Settings" FontSize="16" FontWeight="Bold"
                                  Name="cbxProbSettings" Checked="CheckBox_Checked" 
                                  Unchecked="CheckBox_Unchecked"/>
                    </GroupBox.Header>
                    <s:GameSettings x:Name="gmSettings" />
                </GroupBox>
            </Grid>

        </Grid>
        
        <GridSplitter Grid.Row="2" Height="3" HorizontalAlignment="Stretch" Background="Black" />
    </Grid>
</UserControl>
